package com.servlet;

import com.entity.DinerGoods;
import com.entity.dto.LayuiPage;
import com.service.DinerGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping
public class DinerGoodsServlet {
    @Autowired
    DinerGoodsService dinerGoodsService;

    @RequestMapping(value = "gitDinerGoodsInfo")
    @ResponseBody
    @CrossOrigin
    public LayuiPage<DinerGoods> gitDinerGoodsInfo(Integer categoryId) {
        LayuiPage<DinerGoods> layuiPage=new LayuiPage<>();
        layuiPage.setMsg("OK");
        layuiPage.setData(dinerGoodsService.gitDinerGoodsInfo(categoryId));
        layuiPage.setType("Array");
        return layuiPage;
    }

}
